import {
    post,
    get,
    put,
    Delete,
    form
} from "@/axios/http.js";
import {
    basicApi
} from "@/api/index.js"
//模块数据
export default {
    namespaced: true,
    state: {},
    actions: {
        // 获取登陆者的班级id 学校id
        getSchoolclass({}, params) {
            return get(basicApi.personal.getSchoolclass, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 获取隐私权限
        getVisitAndHidePower({}, params) {
            return get(basicApi.personal.getVisitAndHidePower, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 隐私设置
        visitAndHidePower({}, params) {
            return post(basicApi.personal.visitAndHidePower, params).then(res => {
                if (res.data.code == 200) {
                    return res
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 空间统计
        getSpatial({}, params) {
            return get(basicApi.personal.spatial, params).then(res => {
                return res
            });
        },

        // 个人资料
        getUserInfo({}, params) {
            return get(basicApi.personal.userInfo, params).then(res => {
                return res
            });
        },
        // 根据删除关联编号关联信息
        deleteRelevanceByid({}, params) {
            return Delete(basicApi.personal.deleteRelevanceByid, params).then(res => {
                return res
            });
        },
        // 操作关联用户
        operateRelevanceList({}, params) {
            return get(basicApi.personal.operateRelevanceList, params).then(res => {
                return res
            });
        },
        // 操作关联用户
        operateRelevance({}, params) {
            return post(basicApi.personal.operateRelevance, params).then(res => {
                return res
            });
        },
        // 保存个人资料
        saveUserInfo({}, params) {
            return post(basicApi.personal.updateUser, params).then(res => {
                return res
            });
        },

        // 修改密码
        updatePassword({}, params) {
            return put(basicApi.personal.updatePassword, params).then(res => {
                return res
            });
        },

    },
    mutations: {},
};